package com.gitee.luosl.cola.lang.function.checked;

import java.util.function.Predicate;

@FunctionalInterface
public interface CheckedPredicate<T> {

    boolean test(T t) throws Throwable;

    default Predicate<T> toPredicate() {
        return t -> {
            try {
                return test(t);
            } catch (Throwable throwable) {
                throw new CheckedException(throwable);
            }
        };
    }
}
